package com.lang.controller;

import com.google.gson.Gson;
import com.lang.entity.Type;
import com.lang.service.TypeService;
import com.lang.service.impl.TypeServiceImpl;
import com.lang.utils.StrUtils;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.awt.*;
import java.util.List;

/*
 * @Date : 2024/3/13 9:26
 * @Created by Lang
 * @ProjectName : LclShop
 */
@WebServlet("/type")
public class TypeServlet extends BaseServlet{
    private TypeService typeService = new TypeServiceImpl();
    public String typeList(HttpServletRequest request, HttpServletResponse response){
        List<Type> list = typeService.list();
        return new Gson().toJson(list);
    }
}
